package com.gaokao.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gaokao.demo.entity.College;
import com.gaokao.demo.mapper.CollegeMapper;
import com.gaokao.demo.service.ICollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author szs
 * @since 2021-01-22
 */
@Service
public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> implements ICollegeService {

    @Autowired
    private CollegeMapper collegeMapper;

    @Override
    public IPage<College> getCollegeList(IPage<College> page, Wrapper<College> queryWrapper) {
        return collegeMapper.getCollegeList(page, queryWrapper);
    }

    @Override
    public List<String> getClassifys() {
        return collegeMapper.getClassifys();
    }

    @Override
    public List<Object> getSchoolBumens() {
        return collegeMapper.getSchoolBumens();
    }

    @Override
    public boolean deleteUserById(String id) {
        return collegeMapper.deleteById(id) == 1 ? true : false;
    }

    @Override
    public boolean addCollege(College college) {
        return this.collegeMapper.insert(college) == 1 ? true : false;
    }
}
